/*
 * @(#)BoundContrastPalette.java	0.1 2003. 2. 14.
 * 
 * Copyleft 2002 Wonseok Shin, Taeksoo Jung
 * Anyone can get benefits from this.
 */
package cs348a.color;

/**
 * A <code></code>
 * 
 * @version	0.1
 * @author	Wonseok Shin, Taeksoo Jung
 * @since	0.1
 */
public final class BoundContrastPalette extends BasicPalette {
	/** Singleton instance */
	public static final BoundContrastPalette INSTANCE = getInstance();

	/**
	 * Constructor for <code>ContrastPalette</code>.
	 * 
	 * @param reds array of red components
	 * @param greens array of green components
	 * @param blues array of blue components
	 */
	private BoundContrastPalette(byte[] reds, byte[] greens, byte[] blues) {
		super("Bound Contrast", reds, greens, blues);
	}

	/**
	 * Creates an instance.
	 * 
	 * @return BoundContrastPalette an instance
	 */
	private static BoundContrastPalette getInstance() {
		byte[] reds = ContrastPalette.INSTANCE.getRedComponents();
		byte[] greens = ContrastPalette.INSTANCE.getGreenComponents();
		byte[] blues = ContrastPalette.INSTANCE.getBlueComponents();

		reds[0] = 0;
		greens[0] = 0;
		blues[0] = 0;
		
		reds[SIZE - 1] = (byte) (SIZE - 1);
		greens[SIZE - 1] = (byte) (SIZE - 1);
		blues[SIZE - 1] = (byte) (SIZE - 1);
		
		return new BoundContrastPalette(reds, greens, blues);
	}
}
